<?php echo $this->fetch('header.html'); ?>
<link type="text/css" href="<?php echo $this->res_base . "/" . 'css/integral.css'; ?>" rel="stylesheet"  />
<div id="integral"  class="w-full">
    <div  class="col-1 w clearfix">
        <?php if ($this->_var['user']): ?>
        <div class="personal">
            <div class="info">
                <div class="pic">
                    <div class="avatar">
                        <img src="<?php echo $this->_var['user']['portrait']; ?>" alt="<?php echo htmlspecialchars($this->_var['user']['user_name']); ?>">
                        <a class="tips" href="<?php echo url('app=member'); ?>" target="_blank">
                            <p>总积分:</p>
                            <p><?php echo $this->_var['user']['ugrade']['total_integral']; ?></p>
                        </a>
                    </div>
                </div>
                <div class="text">
                    <p class="pname">亲爱的，<span class="name" title="<?php echo htmlspecialchars($this->_var['user']['user_name']); ?>"><?php echo htmlspecialchars($this->_var['user']['user_name']); ?></span></p>
                    <p class="">欢迎回来</p>
                    <p class="exp">
                        <a href="<?php echo url('app=member'); ?>" target="_blank">
                            您是本商城<?php echo $this->_var['user']['ugrade']['higher_grade_name']; ?>
                        </a>
                    </p>
                </div>
            </div>
            
            <ul class="assets">
                <li>
                    <span class="key">我的商城总积分</span>
                    <a class="value" href="<?php echo url('app=member'); ?>" target="_blank">
                        <?php echo htmlspecialchars($this->_var['user']['total_integral']); ?> 积分
                    </a>
                </li>
                <li class="rowbg">
                    <span class="key">我的商城可用积分</span>
                    <a href="<?php echo url('app=member'); ?>" target="_blank" class="value">
                        <?php echo htmlspecialchars($this->_var['user']['integral']); ?> 积分
                    </a>
                </li>
            </ul>
        </div>
        <?php else: ?>
        <div class="personal">
            <a href="<?php echo url('app=member&act=login'); ?>" class="login">立即登录</a>
            <a href="<?php echo url('app=member&act=register'); ?>" class="register">立即注册</a>
        </div>
        <?php endif; ?>
        <div class="right" area="col-1" widget_type="area">
            <?php $this->display_widgets(array('page'=>'integral','area'=>'col-1')); ?>
        </div>
    </div>
    
    
    <div  class="col-2 w clearfix" area="col-2" widget_type="area" data-position="1">
        <?php $this->display_widgets(array('page'=>'integral','area'=>'col-2')); ?>
    </div>
    
    
    <div class="integral_floor w clearfix">
        <div class="mt">
            <h3>积分抵扣</h3>
        </div>
        <div class="mc clearfix" style="padding: 20px 0">
            <ul class="clearfix">
                <?php $_from = $this->_var['goods_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'goods');$this->_foreach['fe_goods'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['fe_goods']['total'] > 0):
    foreach ($_from AS $this->_var['goods']):
        $this->_foreach['fe_goods']['iteration']++;
?>
                <li>
                    <div class="pic">
                        <a href="<?php echo url('app=goods&id=' . $this->_var['goods']['goods_id']. ''); ?>" target="_blank" ><img class="lazyload" initial-url="<?php echo $this->_var['goods']['default_image']; ?>" /></a>
                    </div>

                    <div class="goods_name">
                        <a href="<?php echo url('app=goods&id=' . $this->_var['goods']['goods_id']. ''); ?>" target="_blank"><?php echo htmlspecialchars($this->_var['goods']['goods_name']); ?></a>
                        <span class="icon"></span>
                    </div>
                    <div class="goods_price">
                        <?php echo price_format($this->_var['goods']['price']); ?>
                    </div>
                    <div class="goods_integral">
                        可使用<span class="red"><?php echo $this->_var['goods']['integral_max_exchange']; ?>积分</span>
                    </div>
                    <div class="btn">
                        <a href="<?php echo url('app=goods&id=' . $this->_var['goods']['goods_id']. ''); ?>" target="_blank" >立即购买</a>
                    </div>
                </li>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
            </ul>
            <?php if (! $this->_var['goods_list_order']): ?><?php echo $this->fetch('page.bottom.html'); ?><?php endif; ?>
        </div>
        
    </div>
    
    
    
    
    
    
    
    <div  class="col-3 w clearfix" area="col-3" widget_type="area" data-position="1">
        <?php $this->display_widgets(array('page'=>'integral','area'=>'col-3')); ?>
    </div>
    
    
</div>


<?php echo $this->fetch('footer.html'); ?>